package com.youkeyi.ddy.cloud.common.api.application.business.crm.source;

import com.youkeyi.ddy.cloud.common.api.application.business.crm.source.dto.BusinessSourceListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.source.param.BusinessSourceCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.source.param.BusinessSourceDeleteCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.source.param.BusinessSourceListCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.crm.source.param.BusinessSourceUpdateCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 客户来源
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Source management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessSourceCloudServiceFallback.class)
@RequestMapping("/business/source")
public interface BusinessSourceCloudService {

    // 查询客户来源列表
    @ApiOperation(value = "Query Customer Source List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.source.BusinessSourceCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessSourceListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Customer Source List", dataType = "BusinessSourceListCloudParam", dataTypeClass = BusinessSourceListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessSourceListCloudDto list(BusinessSourceListCloudParam param);

    // 创建客户来源
    @ApiOperation(value = "Create Customer Source", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.source.BusinessSourceCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Customer Source", dataType = "BusinessSourceCreateCloudParam", dataTypeClass = BusinessSourceCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessSourceCreateCloudParam param);


    // 编辑客户来源
    @ApiOperation(value = "Update Customer Source", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.source.BusinessSourceCloudService.update")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Update Customer Source", dataType = "BusinessSourceUpdateCloudParam", dataTypeClass = BusinessSourceUpdateCloudParam.class),
    })
    @PatchMapping("/update")
    public abstract ResponseContent update(@RequestBody BusinessSourceUpdateCloudParam param);


    // 删除客户来源
    @ApiOperation(value = "Delete Customer Source", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.crm.source.BusinessSourceCloudService.delete")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Delete Customer Source", dataType = "BusinessSourceDeleteCloudParam", dataTypeClass = BusinessSourceDeleteCloudParam.class),
    })
    @DeleteMapping("/delete")
    public abstract ResponseContent delete(BusinessSourceDeleteCloudParam param);

}
